<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>检查任务管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/rw/drRw/">检查任务列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="drRw" action="${ctx}/rw/drRw/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>制定部门：</label>
				<sys:treeselect id="officeZd" name="officeZd.id" value="${drRw.officeZd.id}" labelName="officeZd.name" labelValue="${drRw.officeZd.name}"
					title="制定部门" url="/sys/office/treeData?type=2" cssClass="input-medium" allowClear="true" notAllowSelectParent="false"/>
			</li>  
			<li><label>任务状态：</label>
            	<form:select id="rwFlag" path="rwFlag" class="input-medium">
                	<form:option value="" label="请选择"/>
                    <form:options items="${fns:getDictList('dr_rw_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>
            </li>                           
 			<li><label>任务名称：</label>
            	<form:input path="rwMc" htmlEscape="false" maxlength="50" class="input-xlarge"/>
			</li>        
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th width="17%">任务名称</th>
				<th>制定部门</th>
                <th width="17%">法定事项</th>
                <th width="17%">执法人员</th>
                <th width="17%">执法对象</th>
                <th>任务状态</th>
                <th>制定日期</th>
				<shiro:hasPermission name="rw:drRw:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="drRw">
			<tr>
				<td><a href="${ctx}/rw/drRw/result_?rwid=${drRw.id}">${drRw.rwMc}</a></td>
				<td>${drRw.officeZd.name}</td>
                <td>${drRw.sxMc}</td>
                <td>${drRw.ryMcs}</td>
                <td>${drRw.dxMcs}</td>
                <td>${fns:getDictLabel(drRw.rwFlag, 'dr_rw_flag', '')}</td>
                <td><fmt:formatDate value="${drRw.createDate}" pattern="yyyy-MM-dd"/></td>
				<td>
    				<c:if test="${not empty drRw.jgId}"><a href="${ctx}/jcjg/drJg/viewForm?id=${drRw.jgId}&rwId=${drRw.id}">检查结果</a>&nbsp;</c:if>
                    <shiro:hasPermission name="rw:drRw:edit">
                    <c:if test="${drRw.createBy.id eq fns:getUser().id}">
                    <c:if test="${drRw.rwFlag!='02'}"><a href="${ctx}/rw/drRw/updateFlag?id=${drRw.id}" onClick="return confirmx('确认要完成该检查任务吗？', this.href)">任务完成</a>&nbsp;</c:if>
					<c:if test="${drRw.rwFlag=='00'}"><a href="${ctx}/rw/drRw/delete?id=${drRw.id}" onClick="return confirmx('确认要删除该检查任务吗？', this.href)">删除</a></c:if>
                    </c:if>
                    </shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>